﻿using System.Collections.Generic;
using FactoryMethod.Framework;

namespace FactoryMethod.IDCard
{
    public class IDCardFactory : Factory
    {
        public List<string> owners;

        public IDCardFactory()
        {
            this.owners = new List<string>();
        }

        public List<string> GetOwners()
        {
            return owners;
        }

        public override Product CreateProduct(string owner)
        {
            return new IDCard(owner);
        }

        public override void RegisterProduct(Product product)
        {
            owners.Add(((IDCard)product).GetOwner());
        }
    }
}
